<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="https://www.w3.org/1999/xhtml" lang="zh-CN" xml:lang="zh-CN">
<head><meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
    <title>7.2. LFS-Bootscripts-6.2</title>
    <link rel="stylesheet" href="../stylesheets/lfs.css" type="text/css" />
    <link rel="stylesheet" href="../stylesheets/lfs-print.css" type="text/css" media="print" />
<script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?d286c55b63a3c54a1e43d10d4c203e75"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script>
</head>
  <body id="lfs" class="6.2">
    <div class="navheader">
      <div class="headertitles">
        <h4>Linux From Scratch - 版本 6.2</h4>
        <h3>第七章 配置系统启动脚本</h3>
      </div>
      <ul class="headerlinks">
        <li class="prev">
          <a accesskey="p" href="chapter07.html" title="配置系统启动脚本">后退</a>
          <p>配置系统启动脚本</p>
        </li>
        <li class="next">
          <a accesskey="n" href="usage.html" title="启动脚本是如何工作的?">前进</a>
          <p>启动脚本是如何工作的?</p>
        </li>
        <li class="up"><a accesskey="u" href="chapter07.html" title="第七章 配置系统启动脚本">上一级</a></li>
        <li class="home"><a accesskey="h" href="../index.html" title="Linux From Scratch - 版本 6.2">首页</a></li>
      </ul>
    </div>
    <div class="wrap">
      <div class="titlepage">
        <h1 class="sect1">7.2. LFS-Bootscripts-6.2</h1>
      </div>
      <div class="package">
        <p>LFS-Bootscripts 软件包包含一套在 LFS 系统启动和关闭时的启动和停止脚本。
        </p>
        <div class="segmentedlist">
          <div class="seglistitem">
            <div class="seg">
              <strong><span class="segtitle">预计编译时间：</span></strong> <span class="seg">0.1 SBU</span>
            </div>
            <div class="seg">
              <strong><span class="segtitle">所需磁盘空间：</span></strong> <span class="seg">0.3 MB</span>
            </div>
          </div>
        </div>
        <div class="segmentedlist">
          <div class="seglistitem">
            <div class="seg">
              <strong><span class="segtitle">安装依赖于：</span></strong> <span class="seg">Bash, Coreutils</span>
            </div>
          </div>
        </div>
      </div>
      <div class="installation" lang="en" xml:lang="en">
        <div class="titlepage">
          <h2 class="sect2">
            7.2.1. 安装 LFS-Bootscripts
          </h2>
        </div>
        <p>安装软件包：</p>
        <pre class="userinput"><kbd class="command">make install</kbd></pre>
      </div>
      <div class="content" lang="en" xml:lang="en">
        <div class="titlepage">
          <a id="contents-bootscripts" name="contents-bootscripts"></a>
          <h2 class="sect2">
            7.2.2. Contents of LFS-Bootscripts
          </h2>
        </div>
        <div class="segmentedlist">
          <div class="seglistitem">
            <div class="seg">
              <strong><span class="segtitle">Installed
              scripts:</span></strong> <span class="seg">checkfs, cleanfs,
              console, functions, halt, hotplug, ifdown, ifup, localnet,
              mountfs, mountkernfs, network, rc, reboot, sendsignals,
              setclock, static, swap, sysklogd, template, udev</span>
            </div>
          </div>
        </div>
        <div class="variablelist">
          <h3>
            <a id="id3657616" name="id3657616"></a>简要描述</h3>
          <table border="0">
            <col align="left" valign="top" />
            <tbody>
              <tr>
                <td>
                  <a id="checkfs-bootscripts" name="checkfs-bootscripts"></a><span class="term"><span><strong class="command">checkfs</strong></span></span>
                </td>
                <td>
                  <p>在挂载之前检查文件系统完整性(日志文件系统和基于网络的文件系统除外)
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <a id="cleanfs-bootscripts" name="cleanfs-bootscripts"></a><span class="term"><span><strong class="command">cleanfs</strong></span></span>
                </td>
                <td>
                  <p>删除系统重启后就不需要保存了的文件，例如在 <tt class="filename">/var/run/</tt> 和 <tt class="filename">/var/lock/</tt> 目录下的文件；重新创建 <tt class="filename">/var/run/utmp</tt> 文件并删除可能存在的 <tt class="filename">/etc/nologin</tt>, <tt class="filename">/fastboot</tt>, <tt class="filename">/forcefsck</tt> 文件。
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <a id="console-bootscripts" name="console-bootscripts"></a><span class="term"><span><strong class="command">console</strong></span></span>
                </td>
                <td>
                  <p>为指定的键盘布局读入正确的键盘映射表，并设置屏幕字体。

                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <a id="functions-bootscripts" name="functions-bootscripts"></a><span class="term"><span><strong class="command">functions</strong></span></span>
                </td>
                <td>
                  <p>包含在不同脚本中共用的一些函数，例如错误和状态检查函数。

                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <a id="halt-bootscripts" name="halt-bootscripts"></a><span class="term"><span><strong class="command">halt</strong></span></span>
                </td>
                <td>
                  <p>关闭系统
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <a id="hotplug-bootscripts" name="hotplug-bootscripts"></a><span class="term"><span><strong class="command">hotplug</strong></span></span>
                </td>
                <td>
                  <p>为系统设备加载模块
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <a id="ifdown-bootscripts" name="ifdown-bootscripts"></a><span class="term"><span><strong class="command">ifdown</strong></span></span>
                </td>
                <td>
                  <p>协助 network 脚本停止网络设备
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <a id="ifup-bootscripts" name="ifup-bootscripts"></a><span class="term"><span><strong class="command">ifup</strong></span></span>
                </td>
                <td>
                  <p>协助 network 脚本启动网络设备
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <a id="localnet-bootscripts" name="localnet-bootscripts"></a><span class="term"><span><strong class="command">localnet</strong></span></span>
                </td>
                <td>
                  <p>设置系统主机名和本地回环(loopback)设备
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <a id="mountfs-bootscripts" name="mountfs-bootscripts"></a><span class="term"><span><strong class="command">mountfs</strong></span></span>
                </td>
                <td>
                  <p>挂载所有文件系统，有 <span class="emphasis"><em>noauto</em></span> 标记或者基于网络的文件系统除外。
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <a id="mountkernfs-bootscripts" name="mountkernfs-bootscripts"></a><span class="term"><span><strong class="command">mountkernfs</strong></span></span>
                </td>
                <td>
                  <p>用来挂载内核提供的文件系统，例如 <tt class="systemitem">proc</tt>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <a id="network-bootscripts" name="network-bootscripts"></a><span class="term"><span><strong class="command">network</strong></span></span>
                </td>
                <td>
                  <p>设置网络连接，例如网卡等；并设置默认网关(如果可用) 。
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <a id="rc-bootscripts" name="rc-bootscripts"></a><span class="term"><span><strong class="command">rc</strong></span></span>
                </td>
                <td>
                  <p>主要的运行级控制脚本，负责让所有其它脚本按符号链接名确定的顺序一个接一个的运行。

                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <a id="reboot-bootscripts" name="reboot-bootscripts"></a><span class="term"><span><strong class="command">reboot</strong></span></span>
                </td>
                <td>
                  <p>重新启动系统
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <a id="sendsignals-bootscripts" name="sendsignals-bootscripts"></a><span class="term"><span><strong class="command">sendsignals</strong></span></span>
                </td>
                <td>
                  <p>在系统重启或关闭系统之前，确保每一个进程都已经终止了。

                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <a id="setclock-bootscripts" name="setclock-bootscripts"></a><span class="term"><span><strong class="command">setclock</strong></span></span>
                </td>
                <td>
                  <p>如果硬件时钟没有设置为 UTC 时间，将内核时钟重置为本地时间。

                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <a id="static-bootscripts" name="static-bootscripts"></a><span class="term"><span><strong class="command">static</strong></span></span>
                </td>
                <td>
                  <p>提供为网络接口指派静态 IP 地址的功能
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <a id="swap-bootscripts" name="swap-bootscripts"></a><span class="term"><span><strong class="command">swap</strong></span></span>
                </td>
                <td>
                  <p>启用或禁用交换文件和交换分区
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <a id="sysklogd-bootscripts" name="sysklogd-bootscripts"></a><span class="term"><span><strong class="command">sysklogd</strong></span></span>
                </td>
                <td>
                  <p>启动或停止系统和内核日志守护进程
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <a id="template-bootscripts" name="template-bootscripts"></a><span class="term"><span><strong class="command">template</strong></span></span>
                </td>
                <td>
                  <p>为其它守护进程创建自定义启动脚本的模板
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <a id="udev-bootscripts" name="udev-bootscripts"></a><span class="term"><span><strong class="command">udev</strong></span></span>
                </td>
                <td>
                  <p> 启动 udev 并在 <tt class="filename">/dev</tt> 目录创建设备节点 </p>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
    </div>
    <div class="navfooter">
      <ul>
        <li class="prev">
          <a accesskey="p" href="chapter07.html" title="配置系统启动脚本">后退</a>
          <p> 配置系统启动脚本</p>
        </li>
        <li class="next">
          <a accesskey="n" href="usage.html" title="启动脚本是如何工作的?">前进</a>
          <p> 启动脚本是如何工作的?</p>
        </li>
        <li class="up"><a accesskey="u" href="chapter07.html" title="第七章 配置系统启动脚本">上一级</a></li>
        <li class="home"><a accesskey="h" href="../index.html" title="Linux From Scratch - 版本 6.2">首页</a>.
        </li>
      </ul>
    </div>
</body></html>
